package com.zryc.shop.ums.mapper;

import com.zryc.shop.ums.entity.Resource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 后台资源表 Mapper 接口
 * </p>
 *
 * @author zhaozhao
 * @since 2024-01-16
 */
public interface ResourceMapper extends BaseMapper<Resource> {

    /**
     * 根据角色id查询资源列表
     *
     * @param roleId
     * @return
     */
    List<Resource> getResourceByRoleId(@Param("roleId") Long roleId);

    /**
     * 删除资源以及中间表记录
     *
     * @param id
     * @return
     */
    void deleteForMiddle(@Param("id") Long id);
}
